using System;
using System.Linq;
using System.Text;
using Lawn.SocketClient.ProtoBase;

namespace Demo
{
    public  class MyReceiveFilter : TerminatorReceiveFilter<StringPackageInfo>
    {
        public MyReceiveFilter()
            : base(new byte[]{0x0d}) // two vertical bars as package terminator
        {
        }
	
        // other code you need implement according yoru protocol details

        public override StringPackageInfo ResolvePackage(IBufferStream bufferStream)
        {
           string m= bufferStream.ReadString((int)bufferStream.Length, Encoding.UTF8);
           var ar= m.Split(new string[]{" "}, StringSplitOptions.RemoveEmptyEntries);
           return new StringPackageInfo(ar[0], new BasicStringParser(string.Join(" ",ar.Skip(1))," "));
        }
    }
}